/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cxhd.lis.model.newmodel;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Record;
import java.util.Map;

/**
 *
 * @author 52461
 */
public class LisResult extends Model<LisResult> {

    public void saveResult() {

    }

    public void saveLotsResult() {

    }

    public void saveOne(Map<String, String> re) {

        set("Sample_No", re.get("SAMPLENO"))
                .set("Item_pk", re.get("ITEMPK"))
                .set("Item_Code", re.get("TESTID"))
                .set("Item_Name", re.get("CHINESENAME"))
                .set("Test_Value", re.get("TESTRESULT"))
                .set("Flag_YQ", re.get("DEVICEID"))
                .set("High", re.get("MREFHI0"))
                .set("Low", re.get("MREFLO0"))
                .set("Text_Danwei", re.get("UNIT"))
                .set("Text_Note", re.get("HL_STATUS"))
                .set("Date_Test", re.get("MEASURETIME"))
                .set("uuid", re.get("UUID"))
                .save();

    }
     public void saveOne(Record re) {
         System.out.println(re.toJson());
        set("Sample_No", re.get("SAMPLENO")+"")
                .set("Item_pk", re.get("ITEMPK")+"")
                .set("Item_Code", re.get("TESTID")+"")
                .set("Item_Name", re.get("CHINESENAME")+"")
                .set("Test_Value", re.get("TESTRESULT")+"")
                .set("Flag_YQ", re.get("DEVICEID")+"")
                .set("High", re.getStr("MREFHI0"))
                .set("Low", re.getStr("MREFLO0"))
                .set("Text_Danwei", re.get("UNIT"))
                .set("Text_Note", re.getStr("Text_Note"))
                .set("Date_Test", re.get("MEASURETIME")+"")
                .set("uuid", re.get("UUID")+"")
                 .set("data1", re.get("RESULTFLAG")+"")
                .save();

    }

    public void deleteUUID(String uuid) {

        Db.update("delete * from lis_result where uuid='" + uuid + "'");

    }

}
